<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>友情链接管理</title>
		<link rel="stylesheet" type="text/css" href="../css/style1.css" />
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
		<link rel="stylesheet" type="text/css" href="../css/indexbody.css" />
		<script type="text/javascript" src="../js/frame.js"></script>
		<script type="text/javascript" src="../js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript">
	window.onload=function(){
		document.getElementById("hide").style.display="block";
			document.getElementById("sc").style.display="none";
			document.getElementById("vip").style.display='none';
			document.getElementById("mb").style.display='none';
			document.getElementById("sys").style.display='none';
	}
		function doDelete(id){
		  	if (confirm("你确实要删除(ID:"+id+")这个友情链接吗?")) {
				location.href="<%=path%>/manager/core/deleteLinksAction.action?id="+id;
			}
	  	}
	  		//反选
	function ReSel() {
		$(":checkbox").each(function() {
			$(this).attr("checked", !this.checked);
		});
	}

	//全选
	function SelAll() {
		$(":checkbox").each(function() {
			$(this).attr("checked", true);
		});
	}

	//取消
	function NoneSel() {
		$(":checkbox").each(function() {
			$(this).attr("checked", false);
		});
	}
	function doBatchDelete(){
		  	if (confirm("你确实要批量删除这些友情链接吗?")) {
		  	    location.href="<%=path%>/manager/core/batchDeleteLinksActiion.action";
			}
	  	}
</script>

	</head>

	<body background='../images/allbg.gif' leftmargin='8' topmargin='8'>
		<div id="container">
			<jsp:include page="../header.jsp"></jsp:include>
			<div style="float: left; width: 195px;">
				<jsp:include page="../leftnav.jsp"></jsp:include>
			</div>
			<div
				style="float: left; overflow-y: scroll; overflow-x: hidden; width: 785px; height: 550px;">

				<table width="98%" border="0" align="center" cellpadding="3"
					cellspacing="1" bgcolor="#D6D6D6">
					<tr>
						<td height="28" background="../images/tbg.gif" colspan="8"
							style="padding-left: 10px;">
							<div style="float: left">
								<b>友情链接管理</b>
							</div>
							<div style="float: right; padding-right: 6px;">
								[
								<a href="<%=path%>/manager/core/addLinks.action"><u>增加链接</u>
								</a>]
							</div>
						</td>
					</tr>
					<tr>
						<td height="30" align="center" bgcolor="#F9FCEF" colspan="8">
							<form action="<%=path%>/manager/core/searchLinksAction.action"
								name="form1" method="post">
								<table border="0" cellspacing="0" cellpadding="3"
									style="float: right; margin-right: 10px;">
									<tr>
										<td>
											关键字：
										</td>
										<td>
											<!--  <input name="links.hostName" type="text" id="keyword"
												size="12" style="width: 120px" value="" />-->
												<s:textfield name="links.hostName" theme="simple"></s:textfield>
										</td>
										<td>
											<input name="imageField" class="np" type="image"
												src="../images/button_search.gif" width="60" height="22"
												border="0" />
										</td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
					<tr align="center" bgcolor="#FBFCE2" height="26">
						<td width="4%">
							选择
						</td>
						<td width="18%">
							网站名称
						</td>
						<td width="15%">
							网站Logo
						</td>
						<td width="14%">
							站长Email
						</td>
						<td width="15%">
							时间
						</td>
						<td width="16%">
							网站描述
						</td>
						<td width="6%">
							顺序
						</td>
						<td width="12%">
							管理
						</td>
					</tr>
						<s:iterator value="linkList">
						<tr align="center" bgcolor="#FFFFFF" height="26">
							<td>
								<input type='checkbox' name='checkboxs[]'
									value='<s:property value="id"/>' class='np' />
							</td>
							<td>
								<a href="<s:property value="hostAddress"/>" target='_blank'><s:property
										value="hostName" />
								</a>
							</td>
							<td>
								<a href="<s:property value="hostAddress"/>" target='_blank'><img
										src="<s:property value="hostLogo"/>" alt="网站logo"
										title="网站logo" style="border: 0px;" />
								</a>
							</td>
							<td>
								<s:property value="hostEmail" />
							</td>
							<td>
								<s:property value="createTime" />
							</td>
							<td>
								<s:property value="description" />
							</td>
							<td>
								<s:property value="orders" />
							</td>
							<td>
								<a
									href='<%=path%>/manager/core/findLinksByIdInfo.action?id=<s:property value="id"/>'>[更改]</a>
								<a href="javascript:doDelete('<s:property value='id'/>')">[删除]</a>
							</td>
						</tr>
					</s:iterator>
					<tr bgcolor="#ffffff" height="28">
						<td colspan="8">

							<a href='javascript:SelAll()' class='np coolbg'>[全选]</a>
							<a href='javascript:ReSel()' class='np coolbg'>[反选]</a>
							<a href='javascript:NoneSel()' class='np coolbg'>[取消]</a>
							<a href='javascript:doBatchDelete()' class='np coolbg'>批量删除</a>

						</td>
					</tr>
					<tr align="center" bgcolor="#F9FCEF" height="28">
						<td colspan="8">
							<span>共 1 页/3条记录</span>
						</td>
					</tr>
				</table>
			</div>
		</div>
	</body>
</html>
